package com.olinsports.system.olinsportssystem.repository;

import com.olinsports.system.olinsportssystem.model.CommodityConsumption;
import com.olinsports.system.olinsportssystem.model.InventoryDetails;
import com.olinsports.system.olinsportssystem.model.MultiCondition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * Created by Administrator on 2017/7/23.
 */
@Mapper
@CacheConfig(cacheNames = "commConsum")
public interface CommodityConsumptionRepository {
    @Cacheable
    public List<CommodityConsumption> selectAll();

    @Cacheable
    public int insertAll(CommodityConsumption commodityConsumption);
    @Cacheable
    public int deleteByKey(int conKey);
    @Cacheable
    public CommodityConsumption selectByKey(int conKey);
    @Cacheable
    public int updateData(CommodityConsumption commodityConsumption);
    @Cacheable
    public int findCount();
    @Cacheable
    public List<CommodityConsumption> findLimit(@Param("sord") String sord, @Param("sidx") String sidx, @Param("beg") int beg, @Param("end") int end);

    @Cacheable
    public int selectByDateCount(@Param("startDate") String startDate, @Param("endDate") String endDate);

    @Cacheable
    public List<CommodityConsumption> selectByDateLimit(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("beg") int beg, @Param("end") int end);

    @Cacheable
    public List<CommodityConsumption> selectByDateAll(@Param("startDate") String startDate, @Param("endDate") String endDate);

    @Cacheable
    public int selectSelfCount(@Param("field") String field, @Param("fieldValue") String fieldValue);

    @Cacheable
    public List<CommodityConsumption> selectSelfLimit(@Param("field") String field, @Param("fieldValue") String fieldValue, @Param("beg") int beg, @Param("end") int end);

}
